prepare("insert into temp_sales(ucid,item_category,item_name,qty,unitcost,totalcost) values(:uc,:a,:b,:d,:e,:f)") ; $query->bindparam(":uc",$ucid) ; $query->bindparam(":a",$cat) ; $query->bindparam(":b",$iname) ; //$query->bindparam(":c",$ms) ; $query->bindparam(":d",$qty) ; $query->bindparam(":e",$ucost) ; $query->bindparam(":f",$tcost) ; $query->execute() ; } } if(isset($_POST['commit'])) { //$ivid = inventout() ; $chk = $DBcon->prepare("select * from temp_sales where ucid = '$ucid'") ; $chk->execute() ; if($chk->rowcount() > 0) { $ins = $DBcon->prepare("insert into salesmain(sales_id,sales_date,sales_dept,amount,admin)values(:a,:b,:c,:d,:e)") ; $ins->bindparam(":a",$bkorder) ; $ins->bindparam(":b",$_SESSION['sdate']) ; $ins->bindparam(":c",$_SESSION['sdept']) ; //get total amount $amount = $DBcon->prepare("select sum(totalcost) as tamount from temp_sales where ucid = '$ucid'") ; $amount->execute() ; $arow = $amount->fetch(pdo::FETCH_ASSOC) ; $amt = $arow['tamount'] ; //end getting amount $ins->bindparam(":d",$amt) ; $ins->bindparam(":e",$adm) ; if($ins->execute()) { $getall = $DBcon->prepare("select * from temp_sales where ucid = '$ucid'") ; $getall->execute() ; while($rd = $getall->fetch(pdo::FETCH_ASSOC)) { $comit = $DBcon->prepare("insert into salesdetails(sales_id,item_category,item_name,qty,unitcost,totalcost)values(:a,:b,:c,:e,:f,:g)") ; $comit->bindparam(":a",$bkorder) ; $comit->bindparam(":b",$rd['item_category']) ; $comit->bindparam(":c",$rd['item_name']) ; //$comit->bindparam(":d",$rd['measure']) ; $comit->bindparam(":e",$rd['qty']) ; $comit->bindparam(":f",$rd['unitcost']) ; $comit->bindparam(":g",$rd['totalcost']) ; if($comit->execute()) { $del = $DBcon->prepare("delete from temp_sales where ucid = '$ucid'") ; if($del->execute()) $mos = "RECORD COMMITED SUCCESSFUL TO DATABASE" ; } } } } else { $mos = "NO RECORDS TO MOVE" ; } } ?> Placing Order

Ordering Services

Order_No: Department:   Date:  

Order Preview

prepare("select * from temp_sales") ; $gtd->execute() ; $ct = 0 ; while($grow = $gtd->fetch(pdo::FETCH_ASSOC)) { $ct++ ; ?>
SN CATEGORY ITEM NAME QUANTITY UNIT COST TOTAL COST
DELETE
        Total prepare("select sum(totalcost) as tamt from temp_sales where ucid = '$ucid'") ; $gettotal->execute() ; $ramt = $gettotal->fetch(pdo::FETCH_ASSOC) ; $tamtc = $ramt['tamt'] ; echo $tamtc ; ?>